<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:url('adminIndex/index')}">{:lang('USER_INDEXADMIN_INDEX')}</a></li>
			<li class="active"><a >{:lang('EDIT')}</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('adminIndex/editPost')}">

            <div class="form-group">
                <label for="input-maintain_switch" class="col-sm-2 control-label"><span class="form-required">*</span>选择国家/地区</label>
                <div class="col-md-6 col-sm-10">
                    <select class="form-control" name="country_code">
                        <option value="">--选择国家/地区--</option>
                        <foreach name="country_list" item="vo">
                            <option value="{$vo['tel']}" <if condition="$data.country_code eq $vo.tel">selected</if>>{$vo['name']}</option>
                        </foreach>
                    </select>
                </div>
            </div>

            <div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>手机号</label>
				<div class="col-md-6 col-sm-10" style="padding-top:7px;">
					{$data['user_login']}
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-user_pass" class="col-sm-2 control-label"><span class="form-required">*</span>密码</label>
				<div class="col-md-6 col-sm-10">
					<input type="password" class="form-control" id="input-user_pass" name="user_pass" value="" > 不修改留空  6-12位字母数字组合
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-user_nicename" class="col-sm-2 control-label"><span class="form-required">*</span>昵称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-user_nicename" name="user_nicename" value="{$data['user_nicename']}" maxlength="8" placeholder="8字以内">
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-consumption" class="col-sm-2 control-label"><span class="form-required">*</span>消费总额</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-consumption" name="consumption" value="{$data['consumption']}">控制用户等级
				</div>
			</div>
            
            
            <div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label">头像</label>
				<div class="col-md-6 col-sm-10">
					<input type="hidden" name="avatar" id="thumbnail" value="{$data['avatar']}">
                    <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                        <if condition="empty($data.avatar)">
                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                 id="thumbnail-preview"
                                 style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        <else/>
                        <img src="{:get_upload_path($data.avatar)}"
                             id="thumbnail-preview"
                             style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        </if>
                    </a>
                    <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> 建议尺寸： 600 X 600
				</div>
			</div>
            
            <div class="form-group" id="">
				<label for="input-avatar_thumb" class="col-sm-2 control-label">头像小图</label>
				<div class="col-md-6 col-sm-10">
                    <input type="hidden" name="avatar_thumb" id="thumbnail2" value="{$data['avatar_thumb']}">
                    <a href="javascript:uploadOneImage('图片上传','#thumbnail2');">
                        <if condition="empty($data.avatar_thumb)">
                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                 id="thumbnail2-preview"
                                 style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        <else/>
                        <img src="{:get_upload_path($data.avatar_thumb)}"
                             id="thumbnail2-preview"
                             style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        </if>
                    </a>
                    <input type="button" class="btn btn-sm btn-cancel-thumbnail2" value="取消图片"> 建议尺寸： 100 X 100  分享用
				</div>
			</div>
            
           <div class="form-group">
                <label for="input-maintain_switch" class="col-sm-2 control-label"><span class="form-required">*</span>性别</label>
                <div class="col-md-6 col-sm-10">
                    <select class="form-control" name="sex">
                        <option value="1">男</option>
                        <option value="2" <eq name="data['sex']" value="2">selected</eq>>女</option>
                    </select>
                </div>
            </div>
            
            <div class="form-group">
				<label for="input-swftime" class="col-sm-2 control-label">个性签名</label>
				<div class="col-md-6 col-sm-10">
					<textarea class="form-control" id="input-signature" name="signature" >{$data['signature']}</textarea>
				</div>
			</div>
            

            <div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
                    
					<input type="hidden" name="id" value="{$data.id}" />
                    <input type="hidden" name="avatar_old" value="{$data['avatar']}">
                    <input type="hidden" name="avatar_thumb_old" value="{$data['avatar_thumb']}">

					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>
					<a class="btn btn-default" href="{:url('adminIndex/index')}">{:lang('BACK')}</a>
				</div>
			</div>

		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
    <script type="text/javascript">
        (function(){
            $('.btn-cancel-thumbnail').click(function () {
                $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
                $('#thumbnail').val('');
            });
            
            $('.btn-cancel-thumbnail2').click(function () {
                $('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
                $('#thumbnail2').val('');
            });
        })()

    </script>
</body>
</html>